package vn.com.baseapplication.service;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;

public class BaseReceiver extends BroadcastReceiver implements BaseReceiverListener{
	private static final String BROASTCAST_APP = "baseapplication";
	BaseReceiverListener listener;
	
	public BaseReceiver(BaseReceiverListener listener) {
		this.listener = listener;
	}
	
	
	@Override
	public void onReceive(Context context, Intent intent) {
		listener.onReceive(context, intent);
	}
	
	public IntentFilter getIntentFilter(){
		return new IntentFilter(BROASTCAST_APP);
	}


	@Override
	public void sendBaseBroadcast(Context context,Intent intent) {
		intent.setAction(BROASTCAST_APP);
		context.sendBroadcast(intent);
	}
	
	
}
